Skip to content

Conversation

@ev-sc
Copy link
Member

@ev-sc ev-sc commented Jan 15, 2026

This pull request introduces a new, configurable inspector panel for map views, enabling users to customize which data is displayed and how it is organized for boundaries and other map features. The changes include a database migration for storing inspector configurations, new React components for configuration and data display, and a refactor of the inspector panel to support multiple tabs and improved UI flexibility.

Inspector panel redesign and configuration:

Data display and boundary configuration:

Database and model changes:

  • Added a migration to introduce a new inspector_config JSONB column to the map_view database table, enabling persistent storage of inspector configuration per map view. (migrations/1764611637231_map_view_inspector_config.ts)
  • Ensured new map views are initialized with a default inspectorConfig containing an empty boundaries array. (src/app/map/[id]/components/MapViews.tsx) (src/app/map/[id]/components/MapViews.tsxR91)

Additional tab functionality:

@linear
Copy link

linear bot commented Jan 15, 2026

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joaquimds if you ignore this file in terms of the review. It's just something I got copilot to generate, and which I think is nice to have there as a bog standard overview of the state of the database.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces a configurable inspector panel system for map views, enabling users to customize which boundary data is displayed and how it's organized. The changes add database persistence for inspector configurations, new React components for configuration UI and data display, and a refactored inspector panel with tabbed navigation.

Changes:

  • Added database migration and schema updates to store inspector configurations per map view
  • Implemented new configuration components for selecting data sources and columns to display in the inspector
  • Refactored InspectorPanel to support multiple tabs (data, config, markers, notes) with dynamic sizing

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
migrations/1764611637231_map_view_inspector_config.ts Adds inspector_config JSONB column to map_view table
src/server/services/database/schema.ts Updates MapView interface documentation with new inspector_config field
src/server/models/MapView.ts Defines InspectorConfig and InspectorBoundaryConfig schemas
src/shadcn/ui/multi-select.tsx New multi-select component for choosing columns
src/app/map/[id]/components/TogglePanel.tsx New collapsible panel component for UI organization
src/app/map/[id]/components/inspector/InspectorPanel.tsx Refactored to support tabs and dynamic sizing
src/app/map/[id]/components/inspector/InspectorConfigTab.tsx Configuration UI for boundary data display settings
src/app/map/[id]/components/inspector/InspectorDataTab.tsx Data display tab with support for configured boundaries
src/app/map/[id]/components/inspector/BoundaryConfigItem.tsx Configuration form for individual boundary data sources
src/app/map/[id]/components/inspector/BoundaryDataPanel.tsx Displays boundary data based on configuration
src/app/map/[id]/components/inspector/InspectorMarkersTab.tsx Extracted markers tab component
src/app/map/[id]/components/inspector/InspectorNotesTab.tsx Placeholder notes tab component
src/app/map/[id]/hooks/useInitialMapView.ts Initializes new views with empty inspector config
src/app/map/[id]/components/MapViews.tsx Sets default inspector config when creating views
src/components/DataSourceItem.tsx UI simplification with commented-out code
src/app/map/[id]/page.tsx Added server-side debug logging

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +12 to +24
export function BoundaryDataPanel({
config,
dataSourceId,
areaCode,
columns,
defaultExpanded,
}: {
config: { name: string; dataSourceId: string };
dataSourceId: string;
areaCode: string;
columns: string[];
defaultExpanded: boolean;
}) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config parameter type is loosely defined as an object with name and dataSourceId, but the actual InspectorBoundaryConfig type has additional required fields (type and columns). This creates a type mismatch - the function should accept the full InspectorBoundaryConfig type to ensure type safety.

Copilot uses AI. Check for mistakes.
)}
/>

{Icon}
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icon parameter is typed as React.ReactNode but is being conditionally rendered directly in JSX. When undefined, it will render nothing, which is fine. However, for consistency with the TogglePanelProps interface where rightIconButton is typed as LucideIcon, consider typing icon more specifically or adding a comment explaining that undefined icons are expected and handled correctly.

Copilot uses AI. Check for mistakes.
Comment on lines 64 to 78
<button
className="ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2"
onKeyDown={(e) => {
if (e.key === "Enter") {
handleUnselect(value);
}
}}
onMouseDown={(e) => {
e.preventDefault();
e.stopPropagation();
}}
onClick={() => handleUnselect(value)}
>
<X className="h-3 w-3 text-muted-foreground hover:text-foreground" />
</button>
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The remove button on the badge lacks an accessible label. Screen reader users won't know what this button does. Add an aria-label attribute such as aria-label={Remove ${option?.label}} to improve accessibility.

Copilot uses AI. Check for mistakes.
@joaquimds
Copy link
Member

@ev-sc Approved, merge when ready! So good!!!!

@ev-sc ev-sc merged commit 82408ea into main Jan 15, 2026
1 check passed
@ev-sc ev-sc deleted the feature/CONSULT-5055 branch January 15, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants